@extends('layout.app')

@section('content')

    <div class="box-body">

        <table id="rowed3"></table>
        <div id="prowed3"></div>

    </div>

<script>

$(document).ready(function() {

     var data = {
            url :"/config/game",
            colNames: ['游戏','最少玩家数', '免费试玩模式', '得分', '兑换门槛', '兑换奖励', '兑换率', '默认玩家分数'],
            colModel: [{
                name: 'key',
                editable: true,
                editrules: {
                    required: true,
                },
        	key: true
            },{
                name: 'min_player_count',
                sortable: false,
                editable: true,
                editrules: {
                    required: true,
                    integer: true
                },
            }, {
                name: 'free_trial_model',
                sortable: false,
                editable: true,
                edittype: 'select',
                editoptions: {
                    value: '0:关闭;1:开放',
                },
                formatter: function(cellvalue) {
                	if (cellvalue == true) {
                    	return '开放';
                	}
                	return '关闭';
                },
            }, {
                name: 'cellscore',
                sortable: false,
                editable: true,
                editrules: {
                    required: true,
                    integer: true
                },
            }, {
                name: 'exchange_threshold',
                sortable: false,
                editable: true,
                editrules: {
                    required: true,
                    integer: true
                },
            }, {
                name: 'exchange_extra_reward',
                sortable: false,
                editable: true,
                editrules: {
                    required: true,
                    integer: true
                },
            }, {
                name: 'exchange_rate',
                sortable: false,
                editable: true,
                editrules: {
                	required: true,
                	number:true,
                	minValue:0,
                	maxValue:1,
                }
            }, {
                name: 'default_user_score',
                sortable: false,
                editable: true,
                editrules: {
                    required: true,
                    integer: true
                },
            }],
            caption: "{{$label2}}",
            editurl: "/config/game/edit",
        };

    jqGrid(data, true, true, true);
});

</script>
@endsection